#ifndef SROS_LOCATION_PREDICT_POS_HPP
#define SROS_LOCATION_PREDICT_POS_HPP

#include "predict_by_acc.hpp"

#include <chrono>
#include <deque>

namespace sros::location
{
    class predict_by_pos : public predict_by_acc
    {
    public:
        struct DataPoint
        {
            double position;
            std::chrono::high_resolution_clock::time_point timestamp;
        };

        predict_by_pos() = default;
        ~predict_by_pos() = default;

        void add_pos(const double &pos);

    private:
        void update_cal_();

    private:
        std::mutex            window_mutex_;
        std::deque<DataPoint> data_window_;
        uint32_t              window_size_ = 5;
    };
}


#endif